%%
%课后练习2.3
%1
syms x
fplot(x^4-2^x);
%y = solve(x^4-2^x,x)
y =inline('x^4-2^x','x');
%x = fzero(y,[-2,2])
x2 = fzero(y,-0.86);
[a,b,c] = fsolve(y,-0.86);
%(2)
y2 = inline('x*log((x^2-1)^0.5)+x) - (x^2-1)^0.5-0.5*x','x');

%x1 = fzero(y2,[1,inf])
%x22 = fzero(y2,1)
%[aa,bb,cc] = fsolve(y2,1)
%%
%第三题
%第一步进行画图
syms x y z
fimplicit3(9*x^2+36*y^2+4*z^2-36)
hold on
fimplicit3(x^2-2*y^2-20*z)
hold on
fimplicit3(16*x-x^3-2*y^2-16*z^2)
t0 = [0,0,0];
[t,f,h] = fsolve(@fun,t0);
%%
%4
syms x y
ezplot((x-2)^2+(y+2*x-3)^2-5)
hold on
ezplot(18*(x-3)^2+y^2-36)
hold on
%
y1 = (x-2)^2+(y+2*x-3)^2-5;
y2 = 18*(x-3)^2+y^2-36;

%%
function f = fun(t)
x = t(1);
y = t(2);
z = t(3);
f(1) = 9*x^2+36*y^2+4*z^2-36;
f(2) = x^2-2*y^2-20*z;
f(3) = 16*x-x^3-2*y^2-16*z^2;
end

